<script setup>
import { RouterView } from 'vue-router'
import { computed, onMounted, ref } from 'vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import en from 'element-plus/dist/locale/en.mjs'

const language = ref('zh-cn')
const locale = computed(() => (language.value === 'zh-cn' ? zhCn : en))

const toggle = () => {
   language.value = language.value === 'zh-cn' ? 'en' : 'zh-cn'
}
const show = ref(false)
onMounted(() => {
   show.value = true
})
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://vuejs.org/api/sfc-script-setup.html#script-setup
</script>

<template>
   <div v-if="show">
      <el-config-provider :locale="locale">
         <RouterView></RouterView>
      </el-config-provider>
   </div>
</template>

<style scoped></style>
